<html>
<head><meta charset="utf-8"><title>I-prioritize #80161 Bug in borrow checker with &#x27;while let&#x27; · t-compiler/wg-prioritization/alerts · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/index.html">t-compiler/wg-prioritization/alerts</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html">I-prioritize #80161 Bug in borrow checker with &#x27;while let&#x27;</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="220432637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220432637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> triagebot <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220432637">(Dec 18 2020 at 21:57)</a>:</h4>
<p><span class="user-group-mention" data-user-group-id="3111">@WG-prioritization/alerts</span> issue <a href="https://github.com/rust-lang/rust/issues/80161">#80161</a> has been requested for prioritization.</p>
<h1><a href="https://forge.rust-lang.org/compiler/prioritization/procedure.html#assign-priority-to-unprioritized-issues-with-i-prioritize-label">Procedure</a></h1>
<ul>
<li>Priority?</li>
<li>Regression?</li>
<li>Notify people/groups?</li>
<li>Needs <code>I-nominated</code>?</li>
</ul>



<a name="220432713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220432713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220432713">(Dec 18 2020 at 21:58)</a>:</h4>
<p>I'm not certain this is a bug, but it does seem very confusing. Even if it isn't a bug, it seems the errors could be improved.</p>



<a name="220445412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220445412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220445412">(Dec 19 2020 at 01:06)</a>:</h4>
<p>P-medium maybe? I don't think there's any reason to make it p-high or p-low</p>



<a name="220451797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220451797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220451797">(Dec 19 2020 at 03:39)</a>:</h4>
<p>I feel like maybe P-high would be better: the code is pretty simple and I don't see why it shouldn't compile.</p>



<a name="220451843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220451843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220451843">(Dec 19 2020 at 03:40)</a>:</h4>
<p>But also: I'm surprised that others haven't run into this.</p>



<a name="220451962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220451962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220451962">(Dec 19 2020 at 03:44)</a>:</h4>
<blockquote>
<p><strong>camelid:</strong> Based on testing with Godbolt, it doesn't seem like this code has ever compiled.</p>
</blockquote>



<a name="220451963"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220451963" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220451963">(Dec 19 2020 at 03:44)</a>:</h4>
<p>So P-medium is probably best after all.</p>



<a name="220540245"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220540245" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220540245">(Dec 20 2020 at 22:24)</a>:</h4>
<p>Is this even a bug?</p>



<a name="220540251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220540251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220540251">(Dec 20 2020 at 22:24)</a>:</h4>
<p>It seems like such simple code that it's weird that it could cause a borrowck bug.</p>



<a name="220540310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220540310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220540310">(Dec 20 2020 at 22:26)</a>:</h4>
<p>Aren't the worst bugs the bugs you don't expect? x)</p>



<a name="220540319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220540319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220540319">(Dec 20 2020 at 22:26)</a>:</h4>
<p>I feel like we need input from someone who knows borrowck well. Maybe <span class="user-mention" data-user-id="216206">@lcnr</span> knows? :)</p>



<a name="220540388"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220540388" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220540388">(Dec 20 2020 at 22:28)</a>:</h4>
<p>Could this be related to match guards in some way?</p>



<a name="220540393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220540393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220540393">(Dec 20 2020 at 22:28)</a>:</h4>
<p><del>How so?</del></p>



<a name="220540394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220540394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220540394">(Dec 20 2020 at 22:28)</a>:</h4>
<p>(deleted - wrong topic)</p>



<a name="220540409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220540409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220540409">(Dec 20 2020 at 22:29)</a>:</h4>
<p>Too many issues to prioritize :)</p>



<a name="220540508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220540508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220540508">(Dec 20 2020 at 22:31)</a>:</h4>
<p>I know match guards have some special quirks</p>



<a name="220540583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220540583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220540583">(Dec 20 2020 at 22:33)</a>:</h4>
<p>Bingo!</p>



<a name="220540614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220540614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220540614">(Dec 20 2020 at 22:34)</a>:</h4>
<p>Removing the deref works?</p>



<a name="220540625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220540625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220540625">(Dec 20 2020 at 22:34)</a>:</h4>
<p>About to post...</p>



<a name="220540658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220540658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220540658">(Dec 20 2020 at 22:35)</a>:</h4>
<p>Reposting:</p>
<p>This is interesting: if you change the loop-and-match code to not use match guards, and instead use <code>if</code>-<code>else</code>, you get the same or a very similar borrow-check error to the <code>while let</code> code:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="cp">#[derive(PartialEq, Eq, Clone, Debug)]</span><span class="w"></span>
<span class="k">pub</span><span class="w"> </span><span class="k">struct</span> <span class="nc">ListNode</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">pub</span><span class="w"> </span><span class="n">val</span>: <span class="kt">i32</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="k">pub</span><span class="w"> </span><span class="n">next</span>: <span class="nb">Option</span><span class="o">&lt;</span><span class="nb">Box</span><span class="o">&lt;</span><span class="n">ListNode</span><span class="o">&gt;&gt;</span><span class="p">,</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">impl</span><span class="w"> </span><span class="n">ListNode</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="cp">#[inline]</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">new</span><span class="p">(</span><span class="n">val</span>: <span class="kt">i32</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">Self</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="n">ListNode</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">next</span>: <span class="nb">None</span><span class="p">,</span><span class="w"> </span><span class="n">val</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">remove_elements</span><span class="p">(</span><span class="k">mut</span><span class="w"> </span><span class="n">head</span>: <span class="nb">Option</span><span class="o">&lt;</span><span class="nb">Box</span><span class="o">&lt;</span><span class="n">ListNode</span><span class="o">&gt;&gt;</span><span class="p">,</span><span class="w"> </span><span class="n">val</span>: <span class="kt">i32</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nb">Option</span><span class="o">&lt;</span><span class="nb">Box</span><span class="o">&lt;</span><span class="n">ListNode</span><span class="o">&gt;&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">current</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="n">head</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="k">loop</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="k">match</span><span class="w"> </span><span class="n">current</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="nb">None</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="k">break</span><span class="p">,</span><span class="w"></span>
<span class="w">            </span><span class="nb">Some</span><span class="p">(</span><span class="n">node</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                </span><span class="k">if</span><span class="w"> </span><span class="n">node</span><span class="p">.</span><span class="n">val</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">val</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                    </span><span class="o">*</span><span class="n">current</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">node</span><span class="p">.</span><span class="n">next</span><span class="p">.</span><span class="n">take</span><span class="p">();</span><span class="w"></span>
<span class="w">                </span><span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                    </span><span class="n">current</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="n">node</span><span class="p">.</span><span class="n">next</span><span class="p">;</span><span class="w"></span>
<span class="w">                </span><span class="p">}</span><span class="w"></span>
<span class="w">            </span><span class="p">}</span><span class="w"></span>
<span class="w">        </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="n">head</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>(<a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=2e805118d3a15e14b7324678ea73083d">Playground</a>)</p>
<p>Errors:</p>
<div class="codehilite"><pre><span></span><code>   Compiling playground v0.0.1 (/playground)
error[E0503]: cannot use `*current` because it was mutably borrowed
  --&gt; src/lib.rs:18:13
   |
18 |             None =&gt; break,
   |             ^^^^
   |             |
   |             use of borrowed `current.0`
   |             borrow later used here
19 |             Some(node) =&gt; {
   |                  ---- borrow of `current.0` occurs here

error[E0499]: cannot borrow `current.0` as mutable more than once at a time
  --&gt; src/lib.rs:19:18
   |
19 |             Some(node) =&gt; {
   |                  ^^^^ mutable borrow starts here in previous iteration of loop

error[E0506]: cannot assign to `*current` because it is borrowed
  --&gt; src/lib.rs:21:21
   |
19 |             Some(node) =&gt; {
   |                  ---- borrow of `*current` occurs here
20 |                 if node.val == val {
21 |                     *current = node.next.take();
   |                     ^^^^^^^^
   |                     |
   |                     assignment to borrowed `*current` occurs here
   |                     borrow later used here

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0499, E0503, E0506.
For more information about an error, try `rustc --explain E0499`.
error: could not compile `playground`

To learn more, run the command again with --verbose.
</code></pre></div>
<p>Still not sure if it's a bug though.</p>



<a name="220540911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220540911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220540911">(Dec 20 2020 at 22:42)</a>:</h4>
<p>(deleted)</p>



<a name="220541748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220541748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220541748">(Dec 20 2020 at 23:07)</a>:</h4>
<p><span class="user-mention silent" data-user-id="255061">Léo Lanteri Thauvin</span> <a href="#narrow/stream/245100-t-compiler.2Fwg-prioritization.2Falerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20'while.20let'/near/220540508">said</a>:</p>
<blockquote>
<p>I know match guards have some special quirks</p>
</blockquote>
<p>Maybe related: <a href="https://github.com/rust-lang/rust/blob/c609b2eaf323186a1167ec1a9ffa69a7d4a5b1b9/compiler/rustc_mir_build/src/build/matches/mod.rs#L1570-L1649">https://github.com/rust-lang/rust/blob/c609b2eaf323186a1167ec1a9ffa69a7d4a5b1b9/compiler/rustc_mir_build/src/build/matches/mod.rs#L1570-L1649</a></p>



<a name="220541873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220541873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220541873">(Dec 20 2020 at 23:10)</a>:</h4>
<p>Maybe <span class="user-mention silent" data-user-id="116118">Matthew Jasper</span> knows</p>



<a name="220780650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize%20%2380161%20Bug%20in%20borrow%20checker%20with%20%27while%20let%27/near/220780650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> apiraino <a href="https://rust-lang.github.io/zulip_archive/stream/245100-t-compiler/wg-prioritization/alerts/topic/I-prioritize.20.2380161.20Bug.20in.20borrow.20checker.20with.20&#x27;while.20let&#x27;.html#220780650">(Dec 23 2020 at 11:29)</a>:</h4>
<p>I think a <code>P-medium</code> if we want to keep on the radar somehow. Doesn't look like a huge problematic code</p>
<p>(personally I tend to change my code if the borrowchecker is not happy - I often can't tell if the ownership rules are misbehaving or rather it's me. Therefore I assume the latter case...)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>